package com.baway.common.util

import android.content.Context
import com.baway.common.dialog.LoadingDialog

/**
 * Dialog工具类
 */
object DialogUtils {

    private var loadingDialog: LoadingDialog ? = null

    fun showLoading(context: Context, loadingText: String = "加载中..."){
        //把之前Dialog关闭掉
        dimissLoading()

        //创建Loading对象
        loadingDialog = LoadingDialog(context, loadingText)

        //显示Dialog
        loadingDialog?.show()

    }

    fun dimissLoading(){
        loadingDialog?.dismiss()
        loadingDialog = null
    }



}